public class Numbers
{
   /**
      Returns the number of digits in the binary
      representation of a number
      @param n a nonnegative number
      @return the number of binary digits needed to
      represent n
   */
   
   // TODO: supply the method
   public static int binaryDigits(int nn){
      int k=0;
      if(nn==0)
      k++;
      while(nn!=0){
         k++;
         nn/=2;
      }
      return k;
   }
   
   public static void main(String[] args)
   {
      System.out.println(Numbers.binaryDigits(20));
   }
}